﻿namespace Morus.Infrastructure
{
    using System.ComponentModel;
    using System.Linq;

    public abstract class BaseRepository<TAggregateRoot> : Disposable, IRepository<TAggregateRoot>
        where TAggregateRoot : class, IAggregateRoot
    {
        public abstract void Add(TAggregateRoot aggregateRoot);

        protected abstract IQueryable<TAggregateRoot> GetAll();

        protected abstract IQueryable<TAggregateRoot> Find(ISpecification<TAggregateRoot> specification);

        protected abstract TAggregateRoot Get(ISpecification<TAggregateRoot> specification);

        public abstract void Commit();
    }
}
